package ysq.xyg.recovery.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 回收金模块-中分类实体类
 *
 * @author congcong tao
 * @date 2019-5-8 15:12:12
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_recovery_middle_cat")
public class RecoveryMiddleCat implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	/**
     * 大分类
     */ 
	@Column(name = "large_cat_id")
	private String largeCatId;
	/**
     * 名称
     */ 
	@Column(name = "name")
	private String name;
	/**
     * 图标
     */ 
	@Column(name = "icon")
	private String icon;

	/**
	 * 价格
	 */
	@Column(name = "price")
	private String price;

	/**
	 * 价格单位码
	 * unit_type，1=元/台2=元/个3=元/公斤
	 */
	@Column(name = "rate_price")
	private String ratePrice;

	/**
     * 介绍
     */ 
	@Column(name = "description")
	private String description;
	/**
     * 排序
     */ 
	@Column(name = "order_num")
	private String orderNum;
	/**
     * 有效状态1、有效2、无效
     */ 
	@Column(name = "status")
	private String status;
	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;
	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;
	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	@Transient
	private List<RecoverySmallCat> recoverySmallCatList;
	/**
	 * 价格单位码
	 * unit_type，1=元/台2=元/个3=元/公斤
	 */
	@Transient
	private String ratePriceName;
	public RecoveryMiddleCat(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}